package domain.entities;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@Entity
@Table(name = "traductor", catalog = "bms")
public class Traductor implements java.io.Serializable{
    private Integer id;
    private String name;
    private String surname;
    private String translationCompany;
    private String contact;
    private String phone;
    private String mobilePhone;
    private String email;
    private Address address;

    public Traductor() {
    }

    public Traductor(Address address) {
        this.address = address;
    }

    public Traductor(Integer id, String name, String translationCompany, String contact, String phone, String mobilePhone, String email, Address address) {
        this.id = id;
        this.name = name;
        this.translationCompany = translationCompany;
        this.contact = contact;
        this.phone = phone;
        this.mobilePhone = mobilePhone;
        this.email = email;
        this.address = address;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    @JoinColumn(name = "ADDRESSid", nullable = false)
    public Address getAddress() {
        return this.address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    @Column(name = "surname", nullable = false)
    public String getSurname() {
        return surname;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    @Column(name = "name", nullable = false)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "translationCompany")
    public String getTranslationCompany() {
        return translationCompany;
    }

    public void setTranslationCompany(String translationCompany) {
        this.translationCompany = translationCompany;
    }

    @Column(name = "contact")
    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    @Column(name = "phone", nullable = false)
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Column(name = "mobilePhone", nullable = false)
    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    @Column(name = "email", nullable = false)
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }
}
